﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Admin.CYT369.Com.WebBase;

namespace admin.cyt369.com.Controllers
{
    public partial class SystemsController : Admin.CYT369.Com.WebBase.AuthorizeController
    {
        public ActionResult SystemIndex()
        {
            //ViewBag.User = this.UserSession.GetSessionUser();
            return View();
        }

        #region AppPlugs
        public ActionResult AppPlugsIndex()
        {
            return View("AppPlugs/AppPlugsIndex");
        }

        public ActionResult _EditAppPlugs(int id)
        {
            return View("AppPlugs/_EditAppPlugs");
        }
        #endregion

        #region role
        public IActionResult RoleIndex()
        {
            return View("Roles/Index");
        }

        public IActionResult _EditRole()
        {
            return View("Roles/_EditRole");
        }

        public IActionResult _EditRoleUsers()
        {
            int id = Request.Query.GetInteger("ID", 0);
            var role = Admin.CYT369.Com.DAL.Services.UserService.Instance.GetRoleByID(id);
            return View("Roles/_EditRoleUsers", role);
        }

        public IActionResult _EditPrivalige()
        {
            return View("Roles/_EditPrivalige");
        }

        public IActionResult _AddRoleUser()
        {
            return View("Roles/_AddRoleUser");
        }
        #endregion

        #region Users
        public IActionResult IndexTree()
        {
            return View("Users/IndexTree");
        }

        public IActionResult UserIndex()
        {
            return View("Users/Index");
        }

        public IActionResult _EditUserHasDep()
        {
            return View("Users/_EditUserHasDep");
        }

        public IActionResult _EditUserNoDep()
        {
            return View("Users/_EditUserNoDep");
        }

        public IActionResult _ResetPassword()
        {
            return View("Users/_ResetPassword");
        }

        #endregion

        #region AppMenus
        public ActionResult AppMenusIndex()
        {
            return View("AppMenus/AppMenusIndex");
        }

        public ActionResult _EditAppMenu()
        {
            return View("AppMenus/_EditAppMenu");
        }

        public ActionResult _EditAppMenuModule()
        {
            return View("AppMenus/_EditAppMenuModule");
        }
        

        public ActionResult _EditAppMenuOperation()
        {
            return View("AppMenus/_EditAppMenuOperation");
        }
        #endregion

        #region AppDictionary

        public IActionResult AppDictionaryIndex()
        {
            return View("Config/AppDictionaryIndex");
        }

        public IActionResult _EditAppDictionary()
        {
            return View("Config/_EditAppDictionary");
        }
        #endregion

        #region 系统日志
        public IActionResult SystemLogs()
        {
            return View("SystemLogs/SystemLogs");
        }

        public IActionResult _ShowSystemLogs(long id)
        {
            var log = Admin.CYT369.Com.DAL.Services.AppService.Instance.GetAppLogByID(id);
            return View("SystemLogs/_ShowSystemLogs", log);
        }
        #endregion

    }
}
